package flash.sound.file.wave.tag {
  
  import flash.sound.file.wave.tag.header.IWaveTagHeader;
  import flash.utils.ByteArray;
  import flash.utils.Endian;
  import flash.utils.IDataInput;
  import flash.utils.IDataOutput;
  
  
  /**
  * 
  */
  public class AbstractWaveTag implements IWaveTag {
    
    /**
    * 
    */
    private var _header: IWaveTagHeader;

    /**
    * 
    */
    private var _data: ByteArray = new ByteArray();
    
    /**
    * 
    */
    public function AbstractWaveTag() {
      data.endian = Endian.LITTLE_ENDIAN;
    }
    /**
    * 
    */
    public function set header(value: IWaveTagHeader): void {
      _header = value;
    }
    
    /**
    * 
    */
    public function get header(): IWaveTagHeader {
      return _header;
    }

    /**
    * 
    */
    public function set data(value: ByteArray): void {
      _data = value;
    }
    
    /**
    * 
    */
    public function get data(): ByteArray {
      return _data;
    }
    
    /**
    * 
    */
    public function read(stream: IDataInput): void {      
      data = new ByteArray();
      data.endian = Endian.LITTLE_ENDIAN;
      stream.readBytes(data, 0, header.size)
      data.position = 0;
      readData();
    }
    
    protected function readData(): void {
       
    }
    
    public function write(stream: IDataOutput): void {
      
    }
    
    protected function writeData(): void {
      
    }
  }
}